package reflect;

/**
 * 用于反射机制的测试
 */
public class Person {
    private String name = "周航";
    private int age = 22;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void sayHello(){
        System.out.println(name+":hello!");
    }

    public void sayHi(){
        System.out.println(name+":hi!");
    }

    public void sayGoodbye(){
        System.out.println(name+":bye!");
    }

    public void watchTV(){
        System.out.println(name+":看片");
    }

    public void playGame(){
        System.out.println(name+":玩游戏");
    }

    private void heiheihei(){
        System.out.println("我是"+name+"的私有方法,爱看苍老师,嘿嘿嘿!");
    }


    public String toString() {
        System.out.println("这是toString方法");
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void say(String info){
        System.out.println(name+":"+info);
    }

    public void say(String info,int count){
        for(int i=1;i<count;i++){
            System.out.println(name+":"+info);
        }
    }
}













